#include "EPSG/LookManipulator.h"

#include "EPSG/Camera.h"

EPSG::LookManipulator::LookManipulator( EPSG::Camera* camera )
: EPSG::Manipulator( camera )
{
	
}

bool EPSG::LookManipulator::apply( unsigned char key, int x, int y )
{
	if( _camera == NULL )
		return false;

	switch( key )
	{
	case '8':			// Look up
		_camera->rotate( 1, 0, 0 );
		break;

	case '2':			// Look down
		_camera->rotate( -1, 0, 0 );
		break;

	case '4':			// Look left
		_camera->rotate( 0, 1, 0 );
		break;

	case '6':			// Look right
		_camera->rotate( 0, -1, 0 );
		break;

	case '5':			// Restore default look
		//_camera->setCenter( _camera->getEye() + EPSG::Vec3<float>( 0, 0, -2 ) );
		break;

	default:
		return false;
	}

	return true;
}